#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 2e5 + 5;

int n, m, K;
struct KD {
  int ch[2];
  double v[2];
  double L[2], U[2];
  bool operator<(const KD& b) const { return v[K] < b.v[K]; }
} tr[N];
#define v(p, k) tr[p].v[k]
#define L(p, k) tr[p].L[k]
#define U(p, k) tr[p].U[k]
#define lc(p) tr[p].ch[0]
#define rc(p) tr[p].ch[1]
int root, cur;
double ans = 2e18;
void pushup(int p) {
  rep(k, 0, 1) {
    L(p, k) = U(p, k) = v(p, k);
    if (lc(p)) {
      L(p, k) = min(L(p, k), L(lc(p), k));
      U(p, k) = max(U(p, k), U(lc(p), k));
    }
    if (rc(p)) {
      L(p, k) = min(L(p, k), L(rc(p), k));
      U(p, k) = max(U(p, k), U(rc(p), k));
    }
  }
}
int build(int k, int l, int r) {
  if (l > r) return 0;
  int m = (l + r) >> 1;
  K = k;
  nth_element(tr + l, tr + m, tr + r + 1);
  lc(m) = build(k ^ 1, l, m - 1);
  rc(m) = build(k ^ 1, m + 1, r);
  pushup(m);
  return m;
}
double sq(double x) { return x * x; }
double dis(int p) {
  if (!p) return 2e18;
  double s = 0;
  rep(k, 0, 1) s += sq(v(p, k) - v(cur, k));
  return s;
}
double dis2(int p) {
  if (!p) return 2e18;
  double s = 0;
  rep(k, 0, 1) s +=
      sq(max(v(cur, k) - U(p, k), 0.0)) + sq(max(L(p, k) - v(cur, k), 0.0));
  return s;
}
void query(int p) {
  if (!p) return;
  if (p != cur) ans = min(ans, dis(p));
  double dl = dis2(lc(p)), dr = dis2(rc(p));
  if (dl < dr) {
    if (dl < ans) query(lc(p));
    if (dr < ans) query(rc(p));
  } else {
    if (dr < ans) query(rc(p));
    if (dl < ans) query(lc(p));
  }
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n;
  rep(i, 1, n) cin >> v(i, 0) >> v(i, 1);
  root = build(0, 1, n);
  for (cur = 1; cur <= n; cur++) query(root);
  cout << fixed << setprecision(4) << sqrt(ans);
  return 0;
}